/**
 * 公共方法
*/
//全屏封装
const enterFullScreen = () => {
    let element = document.documentElement;
    if (element.requestFullscreen) {
        element.requestFullscreen();
    } else if (element.mozRequestFullScreen) { /* Firefox */
        element.mozRequestFullScreen();
    } else if (element.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
        element.webkitRequestFullscreen();
    } else if (element.msRequestFullscreen) { /* IE/Edge */
        element.msRequestFullscreen();
    }
}
// 退出全屏
const exitFullScreen = () => {
    if (document.exitFullscreen) {
        document.exitFullscreen();
    } else if (document.mozCancelFullScreen) { /* Firefox */
        document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) { /* Chrome, Safari and Opera */
        document.webkitExitFullscreen();
    } else if (document.msExitFullscreen) { /* IE/Edge */
        document.msExitFullscreen();
    }
}
// 屏幕大小改变时
const onResizeChang = (type, onCallBack = () => { }) => {
    if (type == 'start') {
        // 创建
        window.addEventListener('resize', onCallBack);
    } else if (type == 'end') {
        // 销毁
        window.removeEventListener('resize', onCallBack);
    }
}
export {
    enterFullScreen,
    exitFullScreen,
    onResizeChang,
}